<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">  
  <title>歌手列表</title>
 </head>
 <body>
 
<?php 
 require_once('search.php');

/*
  connect();
 $sql = 'select * from singer';

  //echo $sql.'<br/>';  
  $result = fetch_array($sql); */
 ?>


 <table align="center" width="80%" border=1> 
 <center><h4>歌手信息</h4></center>
 <tr>
   <th>编号</th>
    <th>歌手名</th>
   <th>性别</th>
   <th>生日</th>
   <th>操作</th>
 </tr>

 <?php
  foreach ($result as $row) {
   echo '<tr>';
   echo '<td>'.$row['zqy_id'].'</td>';
   echo '<td><a href="detail.php?id='.$row['zqy_id'].' ">'.$row['zqy_name'].'</a> </td>'; 
      if($row['zqy_sex']=='0')
  {
    $row['zqy_sex']='男';
  }
     if($row['zqy_sex']=='1')
  {
    $row['zqy_sex']='女';
  }
  echo '<td>'.$row['zqy_sex'].'</td>'; 
   echo '<td>'.$row['zqy_birth'].'</td>'; 

   echo '<td><a href="zqyorderEditForm.php?id='.$row['zqyid'].' ">修改</a> | 
    <a href="delsinger.php?id='.$row['zqy_id'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a>
    | <a href="setfirst.php?id='.$row['zqy_id'].' ">设为首页推荐</a> 

   </td>';
   echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>";   
 ?>
 
 </body>



